Add extra_params argument to signin call#369
Add extra_params argument to signin call#369dan-gulliver wants to merge 2 commits intogoogle:mainfrom
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
| additionalParams:(nullable NSDictionary *)extraParams | ||
| completion:(nullable GIDSignInCompletion)completion { | ||
| GIDSignInInternalOptions *options = | ||
| GIDSignInInternalOptions *options = |
There was a problem hiding this comment.
Could you please remove the extra space in the beginning of this line?
| - (void)signInWithPresentingViewController:(UIViewController *)presentingViewController | ||
| hint:(nullable NSString *)hint | ||
| additionalScopes:(nullable NSArray<NSString *> *)additionalScopes | ||
| additionalParams:(nullable NSDictionary *)extraParams |
There was a problem hiding this comment.
Could we keep the original method and create another method with the additionalParams parameter, to prevent breaking existing client integrations with this API? We can have the original method call this method with nil as additionalParams.
| @@ -160,6 +160,7 @@ typedef NS_ERROR_ENUM(kGIDSignInErrorDomain, GIDSignInErrorCode) { | |||
| - (void)signInWithPresentingViewController:(UIViewController *)presentingViewController | |||
There was a problem hiding this comment.
Please add documentation comment on the new parameter.
| completion:completion]; | ||
| [self signInWithOptions:options]; | ||
|
|
||
| if (extraParams != nil) { |
28a2db8 to
a4c63f8
Compare
I wanted to set a custom prompt https://developers.google.com/identity/openid-connect/openid-connect#prompt in the request so that I can always show the Google account list instead of automatically use the logged-in user.
But I couldn't find a way to do it inside this library.
What I saw is that AppAuth supports it by setting it in extraParams: openid/AppAuth-iOS#6 (comment)
The only problem is that I couldn't find a way to set these extraParams from outside of Google Sign in library.
So I added an extra params argument to the signin function and internally set them inside AppAuth call.